package com.yl.chainStore.mapper.warehouse

import com.yl.chainStore.entity.warehouse.WarehouseInOrder
import com.baomidou.mybatisplus.core.mapper.BaseMapper
import com.baomidou.mybatisplus.extension.plugins.pagination.Page
import com.yl.chainStore.common.enums.Status
import com.yl.chainStore.pojo.vo.warehouse.WarehouseInOrderSelectVo
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Param

/**
 * <p>
 * 入库单 Mapper 接口
 * </p>
 *
 * @author cxw
 * @since 2021-06-10
 */
@Mapper
interface WarehouseInOrderMapper : BaseMapper<WarehouseInOrder> {

    /**
     * 分页查询
     * @param status: 只传草稿的状态，防止以后状态数值代表意义更改
     */
    fun getInorderPage(
        @Param("page") page: Page<WarehouseInOrder>,
        @Param("inOrder") inOrder: WarehouseInOrderSelectVo,
        @Param("stagingStatus")status: Status
    ): Page<WarehouseInOrder>

    /**
     * 详情
     */
    fun getInOrderDetail(id: Long): WarehouseInOrder?

    /**
     * 获取某个用户某个状态的订单列表
     */
    fun getUserStagingInOrder(@Param("userId")userId:Long,
                              @Param("warehouseId")warehouseId:Long,
                                @Param("status")status: Status): List<WarehouseInOrder>
}
